package com.photography.pojo;



import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;

@TableName("product")
public class Product implements Serializable {
    @TableId(type = IdType.INPUT)
    private String id;                // 商品id，同时也是商品编号,
    private String productname;     //商品名称,
    private Integer P;                   //
    private BigDecimal price;         //商品价格,
    private String productunit;     //商品单位,
    private BigDecimal purchaseprice;      //进价价格,
    private BigDecimal  sellingprice;   //商品卖价,
    private BigDecimal  makecost;       //制作费用,
    private Integer  alarmcount;    //报警数量,
    private Integer status;            //商品状态，1-上架，2-下架，3-删除,
    @TableField(exist = false)
    private String statusString;
    private String repertorystatus; // 库存状态,
    private String supplier;       //供应商,
    private String processingarea;   // 冲印面积,
    private String note;           //备注,
    private String categoryid;
    private Date created;   // 创建时间
    private Date  updated;   // 更新时间


    public String getStatusString() {
        if (this.getStatus() != null){
            if (this.getStatus() == 1){
                return "正常";
            }else if (this.getStatus() == 2){
                return "<span style=\"color:red;\">下架</span>";
            }
        }
        return "";
    }

    public void setStatusString(String statusString) {
        this.statusString = statusString;
    }


    public String getProductname() {
        return productname;
    }

    public void setProductname(String productname) {
        this.productname = productname;
    }

    public Integer getP() {
        return P;
    }

    public void setP(Integer p) {
        P = p;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public String getProductunit() {
        return productunit;
    }

    public void setProductunit(String productunit) {
        this.productunit = productunit;
    }

    public BigDecimal getPurchaseprice() {
        return purchaseprice;
    }

    public void setPurchaseprice(BigDecimal purchaseprice) {
        this.purchaseprice = purchaseprice;
    }

    public BigDecimal getSellingprice() {
        return sellingprice;
    }

    public void setSellingprice(BigDecimal sellingprice) {
        this.sellingprice = sellingprice;
    }

    public BigDecimal getMakecost() {
        return makecost;
    }

    public void setMakecost(BigDecimal makecost) {
        this.makecost = makecost;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public Integer getAlarmcount() {
        return alarmcount;
    }

    public void setAlarmcount(Integer alarmcount) {
        this.alarmcount = alarmcount;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getRepertorystatus() {
        return repertorystatus;
    }

    public void setRepertorystatus(String repertorystatus) {
        this.repertorystatus = repertorystatus;
    }

    public String getSupplier() {
        return supplier;
    }

    public void setSupplier(String supplier) {
        this.supplier = supplier;
    }

    public String getProcessingarea() {
        return processingarea;
    }

    public void setProcessingarea(String processingarea) {
        this.processingarea = processingarea;
    }

    public String getNote() {
        return note;
    }

    public void setNote(String note) {
        this.note = note;
    }

    public String getCategoryid() {
        return categoryid;
    }

    public void setCategoryid(String categoryid) {
        this.categoryid = categoryid;
    }

    public Date getCreated() {
        return created;
    }

    public void setCreated(Date created) {
        this.created = created;
    }

    public Date getUpdated() {
        return updated;
    }

    public void setUpdated(Date updated) {
        this.updated = updated;
    }


}
